<%--
    Document   : cliente
    Created on : 08/10/2010, 17:42:00
    Author     : renan
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">


<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
<%@taglib prefix="rich" uri="http://richfaces.org/rich"%>

<f:view>
    <h:form id="DECliente">
        <html>
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                <link rel="stylesheet" type="text/css" href="../../css/style.css">
                <script type="text/javascript" src="../../js/funcoes.js"></script>
                <title>Emirates Royal Palace</title>
            </head>
            <body onload="foco();">
                <table>
                    <tr>
                        <td>
                            <div class="principal">
                                <div class="titulo">
                                    <a id="linkTitle" href="../../inicial.jsp"><img alt=""  title="Voltar Inicio" src="../../imagens/Logo.jpg" style="width: 140px; height: 100px; padding-left: 20px; padding-top: 10px;" ></a>
                                </div>
                                <div class="central2">
                                    <table align="center">
                                        <tr>
                                            <td height="500px">
                                                <rich:panel id="painelCadastro" styleClass="tituloTabela">
                                            <f:facet name="header">
                                                <h:outputText value="Cadastro de Clientes"></h:outputText>
                                            </f:facet>
                                            <h:panelGrid columns="1" styleClass="rotulo">
                                                <h:column><h:outputText styleClass="rotulo" value="Nome:"/></h:column>
                                                <h:column><h:inputText id ="nome" onkeydown="mascara(this,maiusculo);" onfocus="ganhouFoco(this);" onblur="perdeuFoco(this);" size="50" maxlength="100" value="#{clienteFrm.cliente.cliente.nome}"/></h:column>
                                                <h:column><h:outputText styleClass="rotulo" value="Telefone:"/></h:column>
                                                <h:column><h:inputText id="telefone" size="50" maxlength="14" onkeydown="mascara(this,telefone)" onfocus="ganhouFoco(this);" onblur="perdeuFoco(this);"  value="#{clienteFrm.cliente.cliente.telefone}"/></h:column>
                                                <h:column><h:outputText styleClass="rotulo" value="Celular:"/></h:column>
                                                <h:column><h:inputText id="celular" size="50" maxlength="14" onkeydown="mascara(this,telefone)" onfocus="ganhouFoco(this);" onblur="perdeuFoco(this);"  value="#{clienteFrm.cliente.cliente.celular}"/></h:column>
                                                <h:column><h:outputText styleClass="rotulo" value="CPF:"/></h:column>
                                                <h:column><h:inputText id="cpf" size="50" maxlength="14" onkeydown="mascara(this,cpf)" onfocus="ganhouFoco(this);" onblur="perdeuFoco(this);"  value="#{clienteFrm.cliente.cliente.cpf}"/></h:column>
                                                <h:column><h:outputText styleClass="rotulo" value="Email:"/></h:column>
                                                <h:column><h:inputText id="email" size="50" onkeydown="mascara(this,maiusculo);" maxlength="50" onfocus="ganhouFoco(this);" onblur="perdeuFoco(this);"  value="#{clienteFrm.cliente.cliente.email}"/></h:column>
                                                <h:column><h:outputText styleClass="rotulo" value="Login:"/></h:column>
                                                <h:column><h:inputText id="login" size="50" onkeydown="mascara(this,maiusculo);" maxlength="10" onfocus="ganhouFoco(this);" onblur="perdeuFoco(this);"  value="#{clienteFrm.cliente.cliente.login}"/></h:column>
                                                <h:column><h:outputText styleClass="rotulo" value="Senha:"/></h:column>
                                                <h:column><h:inputSecret id = "senha" size="20" maxlength="8" onfocus="ganhouFoco(this);" onblur="perdeuFoco(this);" value="#{clienteFrm.cliente.cliente.senha}"/></h:column>
                                                <a4j:commandButton value="Enviar" action="#{clienteFrm.gravarCliente}" reRender="nome,telefone,cpf,login,senha,celular,email,erros"/>
                                                <a4j:status>
                                                    <f:facet name="start">
                                                        <h:graphicImage value="../../imagens/ajax-loader.gif"/>
                                                    </f:facet>
                                                </a4j:status>
                                            </h:panelGrid>
                                        </rich:panel>
                                        <!-- AREA DE MENSAGENS -->
                                        <h:panelGroup id="erros">
                                            <rich:messages globalOnly="true" layout="table" styleClass="textoErro">
                                                <f:facet name="errorMarker">
                                                    <h:graphicImage value="../../imagens/important.png"/>
                                                </f:facet>
                                            </rich:messages>
                                        </h:panelGroup>
                                        </td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </body>
        </html>
    </h:form>
    <script type="text/javascript">
        function foco() {
            el('DECliente:nome').focus();
        }
    </script>
</f:view>






